<template>
  <v-overlay
      :model-value="load"
      class="align-center justify-center bg-green-accent-1"
  >
    <v-progress-circular
        color="primary"
        size="64"
        indeterminate
    ></v-progress-circular>
  </v-overlay>
  <Index v-if="!load"></Index>
</template>

<script setup>
import Index from "./Index.vue";
import {getMediaType} from "./api/mediaApi.js";
import {onMounted, ref} from "vue";
const load = ref(true)
const loading = async () => {
  try {
    const response = await getMediaType();
    if (response && response.code === 200) load.value = false;
    else setTimeout(loading, 300);
  } catch (e) {
    setTimeout(loading, 300);
  }
}

onMounted(() => {
  loading();
})
</script>

<style scoped>
</style>
